!6 6 4
!#vti pla code/lg to asim sidpla convertor <reffsm>
!# 6 inputs, 6 outputs, 4 terms
!#
!#VTI STATE MACHINE
!###############################################################
!###############################################################
!###                                                         ###
!###  IOMD REFFSM : REFRESH STATE MACHINE (FALLING CLOCK)    ###
!###                                                         ###
!###  Created 26/8/92: Ashley Stevens                        ###
!###                                                         ###
!###                                                         ###
!###############################################################
!###############################################################
!###  Revision History:                                      ###
!###                                                         ###
!###############################################################
!sm bussm;
!clock !clk32 32;    # Clocked on falling edge of clk32
!
!reset init --> IDLE; # Not used
!
!inputs  refcyc
!        ras0;
!
!outputs ras1=0
!        ras3=0;
!               
!# state outputs made equal to state:ras3:ras1
!
!state IDLE = 000  
!  refcyc & ras0 --> REF0 ras1=1,
!  --> IDLE;
!
!state REF0 = 001
!  !refcyc --> IDLE,
!  --> REF1 ras1=1 ras3=1;
!
!state REF1 = 011
!  !refcyc --> IDLE,
!  --> REF2 ras1=1 ras3=1;
!
!state REF2 = 111           
!  !refcyc --> IDLE,
!  --> REF3 ras3=1;
!
!state REF3 = 110                       
!  --> IDLE;
!
!end
!!##cell2 * reffsm lg * 12 any 0 v8r3_1
!## "28-Aug-92 GMT" "8:59:58 GMT" "28-Aug-92 GMT" "8:59:58 GMT" astevens * _
!#Assign these values to the symbols:
!#000 : idle
!#001 : ref0
!#011 : ref1
!#111 : ref2
!#110 : ref3
!#Outputs not computed by the PLA:
!#Inputs not used by the PLA:
!#clk32
!#Inputs to the pla, from the left:
!-------|--------
!       |        
!    r  | $$$    
!    e  | sss    
!$$$ fr | rrr rr 
!sss ca | 321 aa 
!rrr ys | ___ ss 
!321 c0 | ddd 13 
!-------|--------
!-------|-+++-++-
!0x1 1x | 011 11 
!xxx xx | 000 00 
!x0x 11 | 001 10 
!x11 1x | 110 01 
!-------|--------
!#SIDLE PROTOTYPE

 FROM STDParts.PLAs  IMPORT $PLA
 FROM STDParts.Misc  IMPORT $Sink,$BDTFF


 BLOCK reffsm(
     clk32,
     refcyc,
     ras0
   )
   =>  (
     ras1,
     ras3
   )
 
   pla = $PLA(Vdd,Vdd,
     in(
     $sr1,
     $sr2,
     $sr3,
     refcyc,
     ras0
    )
   )
   =>  out(
     1$sr1_d,
     1$sr2_d,
     1$sr3_d,
     1ras1,
     1ras3
   )
   WITH (delay=ns_10,filename=iomd/sid/reffsm)
 
   reg = $BDTFF(
    clk32,
     d(
       1$sr1_d,
       1$sr2_d,
       1$sr3_d,
       1ras1,
       1ras3
     ),
     Vdd,Vdd)
   =>  (q(
     $sr1,
     $sr2,
     $sr3,
     ras1,
     ras3
   ),_qbar[4:0])
   WITH (delay=ns_5, edge=-ve)
 
   snk = $Sink(_qbar[4:0])
 
 END {reffsm}
